let seq = 1;
function asyncTask(){
    return new Promise((resolve,reject) =>{
        console.log(`开始异步任务${seq}`);
        //执行成功
        setTimeout(() => resolve(`异步任务${seq}执行成功`),2000);
            //reject("fail")
    });
}

//await只能用在asnys函数里面 await后面加一个promise对象 
async function asyncFun(params) {
   let result = await asyncTask();
   console.log(result);
   seq++;
   result = await asyncTask();
   console.log(result);
   seq++;
   result = await asyncTask();
   console.log(result);
}

asyncFun();